package cn.gzjp.modules.logis.entity;

import cn.gzjp.modules.sys.utils.DictUtils;
import cn.hutool.core.date.DateUtil;
import org.hibernate.validator.constraints.Length;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

/**
 * 发货物流日志Entity
 * @author zengcp
 * @version 2018-03-22
 */
public class LogisDeliveryLog extends DataEntity<LogisDeliveryLog> {
	
	private static final long serialVersionUID = 1L;
	private String openid;		// openid
	private String deliveryId;		// 发货id
	private String status;		// 1叫车成功2司机接单3到达工厂4运输中5到达目的地6已卸车

	private String statusText;

	private String nickName;
	private String mobile;

	private String type;//1订单状态  2货主状态  3司机状态  4保险状态
	
	public LogisDeliveryLog() {
		super();
	}

	public LogisDeliveryLog(String id){
		super(id);
	}

	@Length(min=0, max=32, message="openid长度必须介于 0 和 32 之间")
	@ExcelField(title="openid", align=2, sort=1)
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@Length(min=0, max=32, message="发货id长度必须介于 0 和 32 之间")
	@ExcelField(title="发货id", align=2, sort=2)
	public String getDeliveryId() {
		return deliveryId;
	}

	public void setDeliveryId(String deliveryId) {
		this.deliveryId = deliveryId;
	}
	
	@Length(min=0, max=1, message="1叫车成功2司机接单3到达工厂4运输中5到达目的地6已卸车长度必须介于 0 和 1 之间")
	@ExcelField(title="1叫车成功2司机接单3到达工厂4运输中5到达目的地6已卸车", align=2, sort=3)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStatusText() {
		return DictUtils.getDictLabel(this.getStatus(),"logis_delivery_status","");
	}
	public String getDate(){
		return DateUtil.format(this.getCreateDate(), "MM月dd日 HH:mm");
	}

	public void setStatusText(String statusText) {
		this.statusText = statusText;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}